#include "output.h"

void PrintTable(Stack *ParkLotStack, Queue *CarQueue)
    {
        PrintStack(ParkLotStack);
        PrintQueue(CarQueue);
        getchar();
        getchar();
    }

void PrintStack(Stack *ParkLotStack)
    {
        Car **PtrArr = ParkLotStack->PtrArr;
        int top = ParkLotStack->top;
        printf("In Parking Lot:\n");
        for ( int i = 0; i <= top; i++)
            printf("%s arrived at %s, on [%d]\n", 
                    (*PtrArr[i]).ID, (*PtrArr[i]).ArriveTime, i + 1);
    }

void PrintQueue(Queue *CarQueue)
    {
        printf("In Sidewalk:\n");
        int len = CarQueue->len;
        Car *OptCar = CarQueue->FirstNode;
        for ( int i = 0; i < len; i++, OptCar = OptCar->next)
            printf("%s arrived at %s, on [%d]\n", 
                        OptCar->ID, OptCar->ArriveTime, i + 1);
    }

void OptMenu()
    {
        printf("1. Park New Car\n");
        printf("2. Drive Away\n");
        printf("3. View Car\n");
        printf("4. Print Park Table\n");
        printf("5. Exit\n");
    }

void Hint(int Stage)
    {
        if (Stage == WELCOME)
            printf("Welcome to use PLMS\n");
        if (Stage == SET_PARK_LOT_SIZE)
            {
                printf("set parking lot and sidewalk size\n");
                printf("ParkingLostSize SidewalkSize\n");
            }
        if (Stage == INPUT_CAR_ID)
            printf("The ID of car: ");
        if (Stage == NO_PLACE)
            printf("Parking lot is full !\n");
        if (Stage == SET_SIZE)
            printf("Setting size\nStackSize QueueSize\n");
        if (Stage == COULD_PARK_IN_STACK)
    	    printf("New car could be park in parking lot 1$ per minute \n");
        if (Stage == COULD_PARK_IN_QUEUE)
            printf("New car could be park in sidewalk 1$ per minute\n");
        if (Stage == INVALID_ITEM)
            printf("Invalid Item!\n");
        if (Stage == CAR_NOT_EXIST)
            printf("This car is not exist!\n");
  }
